using Microsoft.EntityFrameworkCore.Migrations;

namespace YoYoMooc.StudentManagement.Services.Migrations
{
    public partial class spInsertStudent : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            var procedure = @"Create Proc spInsertStudent
                                @Name nvarchar(100),
                                @Email nvarchar(100),
                                @PhotoPath nvarchar(100),
                                @MajorEnum int
                                AS
                                BEGIN
                                
                                 INSERT INTO Students
                                       (Name, Email, PhotoPath, Major)
                                   VALUES (@Name, @Email, @PhotoPath, @MajorEnum)
                                END";
            migrationBuilder.Sql(procedure);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            string procedure = @"Drop procedure spInsertStudent";
            migrationBuilder.Sql(procedure);
        }
    }
}
